package DBLayer;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.List;

import modelLayer.SalesOrder;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class DBSalesOrderTest {
	
	private static IFDBSalesOrder dbSo = new DBSalesOrder();

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetAll() {
		p("");
		List<SalesOrder> list = new ArrayList<SalesOrder>();
		
		list = dbSo.getAll(true);
		
		if(list.isEmpty())
		{
			
		}
		else
		{
			
			p("SalesOrder List:");
			for(SalesOrder s : list)
			{
				p("salesorder id :"+s.getSalesOrderID());
			}
		}
		
		
	}

	@Test
	public void testFindSalesOrder() {
		SalesOrder soObj = dbSo.findSalesOrder("440365419", true);
		
		p("");
		p("find SalesOrder:");
		p("SalesOrder id :"+soObj.getSalesOrderID());
	}

	@Test
	public void testInsertSalesOrder() {
		fail("Not yet implemented");
	}

	@Test
	public void testUpdateSalesOrder() {
		fail("Not yet implemented");
	}

	@Test
	public void testDeleteSalesOrder() {
		fail("Not yet implemented");
	}

	
	public void p(String e)
	{
		System.out.println(e);
	}
}
